home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / acpi / powerbtn.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2009-09-23  |  601b  |  19 lines

  1. #!/bin/sh
  2. # /etc/acpi/powerbtn.sh
  3. # Initiates a shutdown when the power putton has been
  4. # pressed.
  5.  
  6. # Skip if we just in the middle of resuming.
  7. test -f /var/lock/acpisleep && exit 0
  8.  
  9. # If gnome-power-manager, kded4, dalston-power-applet or xfce4-power-manager
  10. # are running, let them handle policy This is effectively the same as
  11. # 'acpi-support's '/usr/share/acpi-support/policy-funcs' file.
  12.  
  13. if pidof gnome-power-manager kded4 dalston-power-applet xfce4-power-manager > /dev/null; then
  14.     exit
  15. fi
  16.  
  17. # If all else failed, just initiate a plain shutdown.
  18. /sbin/shutdown -h now "Power button pressed"
  19.